package d2_reflect_test;

import dynamic.Student;

/**
 * @Author:Cjj
 * @Date:2025/5/6
 * 获取Class对象
 */
public class Test1Class {
    public static void main(String[] args) throws ClassNotFoundException {
        Class c1 = Student.class;
        System.out.println(c1.getName());//全类名
        System.out.println(c1.getSimpleName());

        Class<?> c2 = Class.forName("src/main/java/d2_reflect_test/Student.java");
        System.out.println(c1 ==c2);

        Student s = new Student();
        Class c3 = s.getClass();
        System.out.println(c3 == c2);
    }
}
